/*
 * OptionPricer.h
 *
 *	Class that has modules for pricing an option (using MonteCarlo, Black-Scholes etc.,).
 *
 *  Created on: Nov 11, 2009
 *      Author: karthik
 */

#ifndef OPTIONPRICER_H_
#define OPTIONPRICER_H_

#include<string>
#include<vector>

#include "Option.h"

#include "tnt_jama/tnt.h"
#include "tnt_jama/jama_cholesky.h"
#include "tnt_jama/jama_eig.h"

using namespace JAMA;  // JAMA and TNT are defined in namespaces.
using namespace TNT;  // without the "using" statement we would have to write JAMA:: or TNT::

using namespace std;

class OptionPricer{

		Option opt;							//	Option contract data.
		vector<double> starting_prices;		//	Starting prices of the underlyings.
		double rate;						//	Risk-free rate.
		vector<double> vols;				//	Volatilities of the Underlyings.
		Array2D<double> corr_matrix;		//	Correlations among Underlyings.
	public:
		OptionPricer();						//	Default Constructor

		OptionPricer(Option opt,vector<double> starting_prices,double rate,vector<double> vols,Array2D<double> corr_matrix){
			initialize(opt,starting_prices,rate,vols,corr_matrix);
		};
		void initialize(Option,vector<double> starting_prices,double rate,vector<double> vols,Array2D<double> corr_matrix);

		//	Calculate price of the option using MonteCarlo methods using Random Number Generation method defined by randGenMethod argument.
		//	randGenMethod can be Halton, Mersenne-Twister etc.,
		double price(string randGenMethod, int trials, Date present_date);

		virtual ~OptionPricer();		//	Default Destructor
};



#endif /* OPTIONPRICER_H_ */
